﻿CREATE FUNCTION [dbo].[MaxMoney] (@a numeric(38,19),@b numeric(38,19))  
RETURNS numeric(38,2) AS  
BEGIN 

RETURN(
SELECT MAX(v) FROM(SELECT @a v UNION SELECT @b)T
)
END



